﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using DiscoveryLogic.Analytics.DataObjects;

namespace DiscoveryLogic.Analytics.Modules.Entities
{
    /// <summary>
    /// Interaction logic for GrantView.xaml
    /// </summary>
    public partial class GrantView : UserControl
    {
        private readonly GrantPresenter _Presenter;

		public GrantView()
		{
			InitializeComponent();
		}

        public GrantView(GrantPresenter presneter)
            : this()
		{
			_Presenter = presneter;
			_Presenter.View = this;
            _Presenter.SubscribeGrantSelectedEvent(null);
            this.Grant = null;
		}

        public GrantDO Grant 
        {
            set
            {
                this.DataContext = value;
                if (value == null)
                {
                    this.Visibility = System.Windows.Visibility.Collapsed;
                }
                else
                {
                    this.Visibility = System.Windows.Visibility.Visible;
                }
            }
        }
    }
}
